package com.boboPlanet.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.boboPlanet.user.entity.dto.ArtTypeDTO;
import com.boboPlanet.user.entity.po.ArtTypePO;
import com.boboPlanet.user.entity.vo.ArtTypeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: TODO
 * @Author: mis_wu
 * @Date: 2023/2/23
 **/
@Mapper
public interface ArticleTypeMapper extends BaseMapper<ArtTypePO> {

    /**
     * 添加文章中的分类
     * @return List
     */
    List<ArtTypePO> getAllArtTypes();

    List<ArtTypeVO> getAllArtTypesByPage(@Param("dto") ArtTypeDTO dto);

    Integer judgeTypeNameIsExist(@Param("typeName") String typeName);

    /**
     * 作废
     * @param typeIds List
     * @param updater String
     * @return Boolean
     */
    Boolean cancelType(@Param("typeIds") List<Long> typeIds,@Param("updater") String updater);

    /**
     * 恢复
     * @param typeIds List
     * @param updater String
     * @return Boolean
     */
    Boolean resumeTypeByIds(@Param("typeIds") List<Long> typeIds,@Param("updater") String updater);

    List<String> selectTypeNameByIds(@Param("typeIds") List<Long> articleTypeIds);

}
